package cn.wolfcode.wolf2w.business.api;


import cn.wolfcode.wolf2w.business.api.domain.AnswerContent;
import cn.wolfcode.wolf2w.business.api.factory.RemoteAnswerContentFallbackFactory;
import cn.wolfcode.wolf2w.common.core.constant.SecurityConstants;
import cn.wolfcode.wolf2w.common.core.constant.ServiceNameConstants;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
* 答案内容 远程服务
 *
 * @author cmq
 * @date 2024-12-21
 */
@FeignClient(contextId = "RemoteAnswerContentService", name = ServiceNameConstants.QUESTION_SERVICE, fallbackFactory = RemoteAnswerContentFallbackFactory.class)
public interface RemoteAnswerContentService {

    @GetMapping("/answerContents/feign/list")
    R<List<AnswerContent>> list(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/answerContents/feign/{id}")
    R<AnswerContent> getOne(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
